<?php

namespace App\Model;

use Util\Common;

/**
 * 充电套餐
 */
class ChargeOption extends Model
{
//    use TimeZoneTrait;

    public bool $timestamps = true;

    protected ?string $table = 'charge_options';


    protected array $fillable = [
        'id', 'name','is_autoload','distributor_id','sort','is_del','fee'
    ];

    protected array $casts = [
        'created_at' => 'datetime:Y-m-d H:i:s',
        'updated_at' => 'datetime:Y-m-d H:i:s',
    ];

    /**获取默认套餐
     * @return array
     */
    public function getDefaultItems():array
    {
        return $this->where('distributor_id',0)->get()->toArray();
    }
}
